<template>
	<div class="error-page">
		<div class="error-code">4<span>0</span>4</div>
		<div class="error-desc">啊哦~ 你没有访问该页面不存在哦</div>
		<div class="error-handle">
			<router-link to="/">
				<el-button type="primary" size="large" @click="backLogin">返回首页</el-button>
			</router-link>
		<!-- <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> -->
		</div>
	</div>
</template>

<script setup  name="noPrivilege">
import { useRouter,useRoute } from 'vue-router';
import { useTagsStore } from '../stores/tags';
const tags = useTagsStore();
const route  = useRoute()
const router = useRouter()
console.log('route:'+route.meta.title,route.fullPath)

console.log(tags.list)
const goBack = () => {
	router.go(-2);
	const index = tags.list.findIndex(item => item.path == route.fullPath)
	tags.list = tags.list.filter(item=>item.name!=route.name)
	console.log(tags.list)
	
};
const backLogin=()=>{
	console.log("返回首页："+tags.list)
	const index = tags.list.findIndex(item => item.path == route.fullPath)
	tags.list = tags.list.filter(item => item.name != route.name)
	// const index = tags.list.findIndex(item => item.path == route.fullPath)
	// console.log(index)
	// tags.delTagsItem(index);
 	router.push('/dashboard')
}
</script>

<style scoped>
.error-page {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: #f3f3f3;
	box-sizing: border-box;
}
.error-code {
	line-height: 1;
	font-size: 250px;
	font-weight: bolder;
	color: #f02d2d;
}
.error-code span {
	color: #00a854;
}
.error-desc {
	font-size: 30px;
	color: #777;
}
.error-handle {
	margin-top: 30px;
	padding-bottom: 200px;
}
.error-btn {
	margin-left: 100px;
}
</style>
